<?php


namespace app\api\controller;


use app\api\model\Php1;

class Base
{

    public function hello()
    {
        echo '我在602上课';
        echo '<br>';
        echo '我在612上课';
    }

    public function hello1()
    {
        $number = 100;
        echo 'number=', $number;
        echo '<br>';
        echo $number * 5;
        echo '<br>';
        echo "$number=", $number;
    }

    public function hello2()
    {
        //第一步，从浏览器接收
        $address = input('get.address');
        $posi = input('get.posi');

        echo 'TP方式获取GET参数：' .$address;
        echo '<br/>';
        echo 'TP方式获取GET参数：' .$posi;

        //第二步，写入sql代码
        $data = array();
        $data['address'] = $address;
        $data['posi'] = $posi;
        $data['time'] = time();

        //创建一个PHP1模型实例
        $Php1Model = new Php1();
        $Php1Model->insert($data);//执行insert语句
        echo '<br/>';
        echo $Php1Model->getLastSql();

    }
}